//
//  ESignModel.swift
//
//  Created by 邱仙凯 on 2020/8/12
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public class ZyaESignModel: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let filesId = "files_id"
    static let sWorkDt = "s_work_dt"
    static let sType = "s_type"
    static let clientIdcard = "client_idcard"
    static let flowId = "flow_id"
    static let sign1Keyword = "sign1_keyword"
    static let filesUrl = "files_url"
    static let fileName = "file_name"
    static let otherNm = "other_nm"
    static let sWorkId = "s_work_id"
    static let sign2X = "sign2_x"
    static let reportUrl = "report_url"
    static let sMoney = "s_money"
    static let sStatusNm = "s_status_nm"
    static let orgCode = "org_code"
    static let sDjType = "s_dj_type"
    static let idKey = "id_key"
    static let makeDt = "make_dt"
    static let oldFilesUrl = "old_files_url"
    static let makerId = "maker_id"
    static let fileSource = "file_source"
    static let sign1Page = "sign1_page"
    static let rowNum = "row_num"
    static let tableNm = "table_nm"
    static let sign1X = "sign1_x"
    static let sNo = "s_no"
    static let signY = "sign_y"
    static let fileNm = "file_nm"
    static let sign2Keyword = "sign2_keyword"
    static let signPage = "sign_page"
    static let sign2Page = "sign2_page"
    static let isArchive = "is_archive"
    static let clientMobile = "client_mobile"
    static let vouId = "vou_id"
    static let sWorkNm = "s_work_nm"
    static let djType = "dj_type"
    static let orgName = "org_name"
    static let sDate = "s_date"
    static let otherId = "other_id"
    static let sMonth = "s_month"
    static let signKeyword = "sign_keyword"
    static let typeId = "type_id"
    static let sStatus = "s_status"
    static let makerNm = "maker_nm"
    static let sign2Y = "sign2_y"
    static let sign1Y = "sign1_y"
    static let signX = "sign_x"
      static let period = "z_remian_period"
  }

  // MARK: Properties
  public var filesId: String?
  public var sWorkDt: String?
  public var sType: String?
  public var clientIdcard: String?
  public var flowId: String?
  public var sign1Keyword: String?
  public var filesUrl: String?
  public var fileName: String?
  public var otherNm: String?
  public var sWorkId: Int?
  public var sign2X: String?
  public var reportUrl: String?
  public var sMoney: Double?
  public var sStatusNm: String?
  public var orgCode: String?
  public var sDjType: String?
  public var idKey: String?
  public var makeDt: String?
  public var oldFilesUrl: String?
  public var makerId: Int?
  public var fileSource: String?
  public var sign1Page: String?
  public var rowNum: Int?
  public var tableNm: String?
  public var sign1X: String?
  public var sNo: String?
  public var signY: String?
  public var fileNm: String?
  public var sign2Keyword: String?
  public var signPage: String?
  public var sign2Page: String?
  public var isArchive: String?
  public var clientMobile: String?
  public var vouId: String?
  public var sWorkNm: String?
  public var djType: Int?
  public var orgName: String?
  public var sDate: String?
  public var otherId: String?
  public var sMonth: String?
  public var signKeyword: String?
  public var typeId: Int?
  public var sStatus: Int?
  public var makerNm: String?
  public var sign2Y: String?
  public var sign1Y: String?
  public var signX: String?
    public var period: Int?
    
        // 只赋值和展示
    public  var inLibrary: String?
    public  var payment: String?
    public var out_library: String?
    public var invoice: String?
    public var contract: String?
  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public required init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public func mapping(map: Map) {
    filesId <- map[SerializationKeys.filesId]
    sWorkDt <- map[SerializationKeys.sWorkDt]
    sType <- map[SerializationKeys.sType]
    clientIdcard <- map[SerializationKeys.clientIdcard]
    flowId <- map[SerializationKeys.flowId]
    sign1Keyword <- map[SerializationKeys.sign1Keyword]
    filesUrl <- map[SerializationKeys.filesUrl]
    fileName <- map[SerializationKeys.fileName]
    otherNm <- map[SerializationKeys.otherNm]
    sWorkId <- map[SerializationKeys.sWorkId]
    sign2X <- map[SerializationKeys.sign2X]
    reportUrl <- map[SerializationKeys.reportUrl]
    sMoney <- map[SerializationKeys.sMoney]
    sStatusNm <- map[SerializationKeys.sStatusNm]
    orgCode <- (map[SerializationKeys.orgCode],StringTransform())
    sDjType <- map[SerializationKeys.sDjType]
    idKey <- (map[SerializationKeys.idKey],StringTransform())
    makeDt <- map[SerializationKeys.makeDt]
    oldFilesUrl <- map[SerializationKeys.oldFilesUrl]
    makerId <- map[SerializationKeys.makerId]
    fileSource <- (map[SerializationKeys.fileSource],StringTransform())
    sign1Page <- map[SerializationKeys.sign1Page]
    rowNum <- map[SerializationKeys.rowNum]
    tableNm <- map[SerializationKeys.tableNm]
    sign1X <- map[SerializationKeys.sign1X]
    sNo <- map[SerializationKeys.sNo]
    signY <- map[SerializationKeys.signY]
    fileNm <- map[SerializationKeys.fileNm]
    sign2Keyword <- map[SerializationKeys.sign2Keyword]
    signPage <- map[SerializationKeys.signPage]
    sign2Page <- map[SerializationKeys.sign2Page]
    isArchive <- map[SerializationKeys.isArchive]
    clientMobile <- map[SerializationKeys.clientMobile]
    vouId <- (map[SerializationKeys.vouId],StringTransform())
    sWorkNm <- map[SerializationKeys.sWorkNm]
    djType <- map[SerializationKeys.djType]
    orgName <- map[SerializationKeys.orgName]
    sDate <- map[SerializationKeys.sDate]
    otherId <- (map[SerializationKeys.otherId],StringTransform())
    sMonth <- map[SerializationKeys.sMonth]
    signKeyword <- map[SerializationKeys.signKeyword]
    typeId <- map[SerializationKeys.typeId]
    sStatus <- map[SerializationKeys.sStatus]
    makerNm <- map[SerializationKeys.makerNm]
    sign2Y <- map[SerializationKeys.sign2Y]
    sign1Y <- map[SerializationKeys.sign1Y]
    signX <- map[SerializationKeys.signX]
      period <- map[SerializationKeys.period]
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = filesId { dictionary[SerializationKeys.filesId] = value }
    if let value = sWorkDt { dictionary[SerializationKeys.sWorkDt] = value }
    if let value = sType { dictionary[SerializationKeys.sType] = value }
    if let value = clientIdcard { dictionary[SerializationKeys.clientIdcard] = value }
    if let value = flowId { dictionary[SerializationKeys.flowId] = value }
    if let value = sign1Keyword { dictionary[SerializationKeys.sign1Keyword] = value }
    if let value = filesUrl { dictionary[SerializationKeys.filesUrl] = value }
    if let value = fileName { dictionary[SerializationKeys.fileName] = value }
    if let value = otherNm { dictionary[SerializationKeys.otherNm] = value }
    if let value = sWorkId { dictionary[SerializationKeys.sWorkId] = value }
    if let value = sign2X { dictionary[SerializationKeys.sign2X] = value }
    if let value = reportUrl { dictionary[SerializationKeys.reportUrl] = value }
    if let value = sMoney { dictionary[SerializationKeys.sMoney] = value }
    if let value = sStatusNm { dictionary[SerializationKeys.sStatusNm] = value }
    if let value = orgCode { dictionary[SerializationKeys.orgCode] = value }
    if let value = sDjType { dictionary[SerializationKeys.sDjType] = value }
    if let value = idKey { dictionary[SerializationKeys.idKey] = value }
    if let value = makeDt { dictionary[SerializationKeys.makeDt] = value }
    if let value = oldFilesUrl { dictionary[SerializationKeys.oldFilesUrl] = value }
    if let value = makerId { dictionary[SerializationKeys.makerId] = value }
    if let value = fileSource { dictionary[SerializationKeys.fileSource] = value }
    if let value = sign1Page { dictionary[SerializationKeys.sign1Page] = value }
    if let value = rowNum { dictionary[SerializationKeys.rowNum] = value }
    if let value = tableNm { dictionary[SerializationKeys.tableNm] = value }
    if let value = sign1X { dictionary[SerializationKeys.sign1X] = value }
    if let value = sNo { dictionary[SerializationKeys.sNo] = value }
    if let value = signY { dictionary[SerializationKeys.signY] = value }
    if let value = fileNm { dictionary[SerializationKeys.fileNm] = value }
    if let value = sign2Keyword { dictionary[SerializationKeys.sign2Keyword] = value }
    if let value = signPage { dictionary[SerializationKeys.signPage] = value }
    if let value = sign2Page { dictionary[SerializationKeys.sign2Page] = value }
    if let value = isArchive { dictionary[SerializationKeys.isArchive] = value }
    if let value = clientMobile { dictionary[SerializationKeys.clientMobile] = value }
    if let value = vouId { dictionary[SerializationKeys.vouId] = value }
    if let value = sWorkNm { dictionary[SerializationKeys.sWorkNm] = value }
    if let value = djType { dictionary[SerializationKeys.djType] = value }
    if let value = orgName { dictionary[SerializationKeys.orgName] = value }
    if let value = sDate { dictionary[SerializationKeys.sDate] = value }
    if let value = otherId { dictionary[SerializationKeys.otherId] = value }
    if let value = sMonth { dictionary[SerializationKeys.sMonth] = value }
    if let value = signKeyword { dictionary[SerializationKeys.signKeyword] = value }
    if let value = typeId { dictionary[SerializationKeys.typeId] = value }
    if let value = sStatus { dictionary[SerializationKeys.sStatus] = value }
    if let value = makerNm { dictionary[SerializationKeys.makerNm] = value }
    if let value = sign2Y { dictionary[SerializationKeys.sign2Y] = value }
    if let value = sign1Y { dictionary[SerializationKeys.sign1Y] = value }
    if let value = signX { dictionary[SerializationKeys.signX] = value }
      if let value = period { dictionary[SerializationKeys.period] = value }
    return dictionary
  }

}
struct ZyaDzhtRateModel: Mappable {
   
    var inLibrary: String?
    var payment: String?
    var z_ht_no: String?
    var out_library: String?
    var invoice: String?
    var contract: String?
  
   
     init?(map: Map) {
        
    }
    // Mappable
    mutating func mapping(map: Map) {
        inLibrary <- map["inLibrary"]
        payment <- map["payment"]
        z_ht_no <- map["z_ht_no"]
        
        out_library <- map["out_library"]
        invoice <- map["invoice"]
        contract <- map["contract"]
        
     }
}

 
struct ZyaEsFileModel: Mappable {
   
    var id_key: String?
    var pic_url: String?
    var pic_name: String?
     init?(map: Map) {
        
    }
    // Mappable
    mutating func mapping(map: Map) {
        id_key <- (map["id_key"],StringTransform())
        pic_url <- map["pic_url"]
        pic_name <- map["pic_name"]
     }
}
struct ZyaEsPayModel: Mappable {
   
    var money_cancel: String?
    var no: String?
    var in_date: String?
    var cn_dt: String?
     init?(map: Map) {
        
    }
    // Mappable
    mutating func mapping(map: Map) {
        money_cancel <- (map["money_cancel"],StringTransform())
        no <- map["no"]
        in_date <- map["in_date"]
        cn_dt <- map["cn_dt"]
     }
}
 
